const mysql = require('mysql')

const mysql_user = {
    host:'121.4.62.38',
    user:'remote_user',//用户名
    password:'MSE-2022g11',//密码
    database:'MSE2022',
    port:3306
};

const conn = mysql.createConnection(mysql_user);
console.log("createConnection");

conn.connect((err) => {
    if(err) {
        console.log("数据库连接失败");
    }
    else{
        console.log("数据库连接成功");
    }
})

conn.query('select * from school', function (error, results, fields) {
    if (error) throw error;
    console.log("table school:");
    console.log(results);
});
